﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AdvplDoc.Model {

	class AdvplProperty {
		public string name { get; set; }
		public string description { get; set; }
		public AdvplType type { get; set; }
		public string since { get; set; }
		public bool isDeprecated { get; set; }
		public string deprecatedInfo { get; set; }
		public List<string> seeAlso { get; set; }
        public string defaultValue { get; set; }
        public List<string> observation { get; set; }

		public AdvplProperty(	AdvplType type, 
								string name, 
								string desc,
                                List<string> obs,
								string since, 
								bool is_deprecated,
								string deprecated_info,
								List<string> seealso,
                                string defaultValue) {
			this.type = type;
			this.name = name;
			this.description = desc;
			this.since = since;
			this.isDeprecated = is_deprecated;
			this.deprecatedInfo = deprecated_info;
			this.seeAlso = seealso;
            this.defaultValue = defaultValue;
            this.observation = obs;
		}

		public bool hasMoreInfo() {
			return (this.isDeprecated ||
					this.description != "" ||
					this.since != "" ||
					this.seeAlso.Count > 0);
		}
		
		public override string ToString() {
			return "Propriedade ADVPL " + this.type.ToString() + " " + this.name;
		}
	}

}
